package com.hs.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hs.entity.PsyAss;
import com.hs.mapper.PsyAssMapper;
import com.hs.service.PsyAssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PsyAssServiceImpl implements PsyAssService {
    @Autowired
    private PsyAssMapper psyAssMapper;

    @Override
    public int addPsyAss(PsyAss psyAss) {
        return psyAssMapper.addPsyAss(psyAss);
    }

    @Override
    public int deletePsyAss(int id) {
        return psyAssMapper.deletePsyAss(id);
    }

    @Override
    public int updatePsyAss(PsyAss psyAss) {
        return psyAssMapper.updatePsyAss(psyAss);
    }

    @Override
    public PsyAss getpsyassById(int id) {
        return psyAssMapper.getpsyassById(id);
    }
    @Override
    public PageInfo<PsyAss> getpsyassByPage(PsyAss psyAss, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<PsyAss> psyassByPage = psyAssMapper.getpsyassByPage(psyAss);
        PageInfo<PsyAss> pageInfo = new PageInfo<>(psyassByPage);
        return pageInfo;
    }

    @Override
    public PageInfo<PsyAss> getpayasslist(PsyAss psyAss) {
        List<PsyAss> getpayasslist = psyAssMapper.getpayasslist(psyAss);
        PageInfo<PsyAss> pageInfo = new PageInfo<>(getpayasslist);
        return pageInfo;
    }
}
